package lanqiao;

public class test1 {
    //谁说谎？
    //
    //张三说李四在说谎，李四说王五在说谎，王五说张三和李四都在说谎。
    //
    //现在问：这三人中到底谁说的是真话，谁说的是假话？
    public static void main(String[] args) {
        int a, b, c;
        for (a = 0; a <= 1; a++) {
            for (b = 0; b <= 1; b++) {
                for (c = 0; c <= 1; c++) {
                    boolean atrue = (a == 1 && b == 0);
                    boolean afalse = (a == 0 && b == 1);
                    boolean btrue = (b == 1 && c == 0);
                    boolean bfalse = (b == 0 && c == 1);
                    boolean ctrue = (c == 1 && (a == 1 && b == 1));
                    boolean cfalse = (c == 0 && (a == 1 || b == 1));

                    boolean ajundge = (atrue || afalse);
                    boolean bjundge = (btrue || bfalse);
                    boolean cjundge = (ctrue || cfalse);

                    if(ajundge&&bjundge&&cjundge){
                        System.out.println("a="+a);
                        System.out.println("b="+b);
                        System.out.println("c="+c);

                    }
                }
            }
        }

    }
}
